package xtcp

import (
	"gitee.com/cooge/impush/config"
	log "github.com/sirupsen/logrus"
)

func Start() {
	go startServer()
}

func startServer() {
	tcpServer := NewXTcpServer()
	err := tcpServer.Bind(config.TCP_PORT)
	if err == nil {
		for {
			conn, err := tcpServer.Accept()
			if err == nil {
				conn.Start()
			} else {
				log.Info("TCP服务出现系统故障", err)
			}
		}

	}
}
